Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LoggerMock.Fatal() bug fixes #56

Merged
merged 3 commits into from
Feb 2, 2022
Merged

Conversation

zackverham
Copy link
Contributor

Intent

Fixes two bugs with the Fatal function in the mocked logger:

  1. Fatal wasn't adding its logging operation to the mock's internal call stack, causing LastCall() assertions to fail
  2. Because Fatal has a different method signature than the other formatted logging statements, AllowAny was failing to register the correct method signature.

Automated Tests

I added a new test to validate the change and confirm that the rest of the logging functions use the call stack as expected. The test also implicitly confirms AllowAny behavior by allowing all logging operations.

Miscellaneous

I added a todo comment in LoggerMock.AllowAny which I think could be worth some discussion - the design could totally be the right approach, but I'm just curious why we use string parameters rather than an enumerated type here.

Copy link
Contributor

@marcosnav marcosnav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that it might be good to try out having types/enums for the allowed methods (AllowAny). Not required in this PR 🙂

@zackverham zackverham merged commit 2a8460d into main Feb 2, 2022
@jonyoder jonyoder deleted the zack-update-mock-logger-fatal branch February 7, 2022 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants